#pragma once
#include "../core.h"
#include "../strings/BaseString.h"

namespace qb {
namespace base {
class S_CORE_EXPORT HeapAllocator {
  int m_usedsize;  // 已经使用的内存
  BaseString m_name;

 private:
  HeapAllocator() = delete;
  HeapAllocator(const HeapAllocator& heap) = delete;
  HeapAllocator& operator=(const HeapAllocator& heap) = delete;

 public:
  HeapAllocator(const char* name);
  ~HeapAllocator();
  void Reset();
  void* Alloc(int bytes);
  void Free(void* ptr, int bytes);
  static void DumpAllHeaps();

 public:
  int GetBytes() const;
  void DumpStatus();
};
}  // namespace base
}  // namespace qb
